Skip to content

Comments

feat: add xrp support#727

Merged
netbonus merged 6 commits intodevfrom
baha/feat/add-xrp-support
Feb 24, 2026
Merged

feat: add xrp support#727
netbonus merged 6 commits intodevfrom
baha/feat/add-xrp-support

Conversation

@yilmazbahadir
Copy link
Collaborator

@yilmazbahadir yilmazbahadir commented Feb 23, 2026

📝 Summary

Adds first-party XRP support to gridplus-sdk using the new chain plugin architecture, including runtime registration, SDK helper APIs, protocol/constants updates, docs, and XRP e2e coverage.
Also includes follow-up lint/typecheck fixes for XRP e2e tests.

🔧 Context / Implementation

  • Added new chain package: @gridplus/xrp
    • packages/chains/xrp/src/chain.ts
    • packages/chains/xrp/src/devices/lattice.ts
    • packages/chains/xrp/src/index.ts
  • Registered XRP as a built-in default chain plugin in SDK:
    • packages/sdk/src/chains/defaultManifest.ts
  • Added public SDK XRP APIs:
    • fetchXrpAddresses(...) in packages/sdk/src/api/addresses.ts
    • signXrp(...) in packages/sdk/src/api/signing.ts
  • Added protocol and constant support required for XRP generic signing:
    • SHA512HALF hash support
    • XRP encoding support
    • XRP derivation/coin constants
    • updates in packages/types/* and packages/sdk/src/constants.ts
  • Updated docs for XRP usage and chain modules:
    • packages/docs/docs/addresses.md
    • packages/docs/docs/signing.md
    • packages/docs/docs/intro.md
    • packages/docs/docs/chain-modules.md
  • Added/updated tests:
    • XRP e2e signing tests
    • default chain manifest test coverage
    • follow-up lint/type fixes in e2e test files

🧪 Test Plan

  1. pnpm lint
  2. pnpm typecheck
  3. pnpm --filter gridplus-sdk run test-unit
  4. pnpm --filter gridplus-sdk run e2e-sign-xrp (with simulator and test firmware capabilities)

Expected result:

  • Lint/typecheck/unit tests pass.
  • XRP appears in default chain plugins.
  • fetchXrpAddresses and signXrp work through SDK helper APIs.
  • XRP e2e signing passes on supported simulator/firmware capability set.

🖼️ Screenshots (if applicable)

Before After
XRP not supported as a first-party chain in SDK XRP supported via built-in chain plugin + helper APIs and e2e coverage

- add new @gridplus/xrp chain package (module, lattice signer plugin, shared helpers)
- register xrp:lattice in SDK default chain manifest
- add public SDK helpers: fetchXrpAddresses() and signXrp()
- extend protocol/constants/types with SHA512HALF + XRP encoding support
- gate XRP generic-signing capabilities by firmware version (>= 0.18.10)
- allow XRP coin type in derivation path validation and add XRP derivation constant
- add XRP e2e signing coverage and default manifest unit assertion
- update docs/sidebar/architecture docs for XRP and chain-modules page
- update workspace scripts/deps and pnpm lockfile for @gridplus/xrp
- replace `catch (err: any)` with `unknown` handling in general e2e tests
- format xrp e2e vector literals and xrp signer queue call for biome
- type xrp capability maps as `Record<string, unknown>` to satisfy typecheck
Move compressSecp256k1Pubkey to one xrp shared module and re-export from chain/devices.

Replace repeated XRP e2e timeout literals with constants and localize one-off test client setup.
@yilmazbahadir yilmazbahadir force-pushed the baha/feat/add-xrp-support branch from 538af46 to e5920e9 Compare February 24, 2026 20:32
@yilmazbahadir yilmazbahadir changed the base branch from baha/feat/asset-modules to dev February 24, 2026 20:35
@yilmazbahadir yilmazbahadir marked this pull request as ready for review February 24, 2026 20:36
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5920e9293

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (!legacy && gte(v, [0, 18, 10])) {
c.genericSigning.hashTypes = {
...c.genericSigning.hashTypes,
SHA512HALF: EXTERNAL.SIGNING.HASHES.SHA512HALF,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Implement SHA512HALF prehash path for large payloads

Adding SHA512HALF to genericSigning.hashTypes enables XRP signing requests, but buildGenericSigningMsgRequest in packages/sdk/src/genericSigning.ts still only prehashes KECCAK256 and SHA256 when payloads exceed maxExpandedSz; for SHA512HALF it falls into Unsupported hash type.. This causes signXrp to fail for large XRPL preimages (for example transactions with large memo payloads) that require prehashing, even on firmware versions that advertise XRP/SHA512HALF support.

Useful? React with 👍 / 👎.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/GridPlus/gridplus-sdk@727

commit: 13f9900

Move toBuffer, parseHexBytes, buildSigResultFromRsv, and
compressSecp256k1Pubkey into chain-core and re-export from each
chain's devices/shared.ts so consumer imports stay unchanged.
@netbonus netbonus merged commit 6ca05ad into dev Feb 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants